package com.javaear.beangenerator.tools;

import java.util.Collection;

/**
 * Assert for grace the code and check the params
 *
 * @author aooer
 */
public class Assert {

    /**
     * notnull
     *
     * @param object object
     */
    public static void notNull(Object object) {
        if (object == null)
            throw new IllegalArgumentException("[Assertion failed] - this argument is required; it must not be null");
    }

    /**
     * not empty
     *
     * @param collection collection
     */
    public static void notEmpty(Collection<?> collection) {
        if (collection == null || collection.isEmpty())
            throw new IllegalArgumentException("[Assertion failed] - this array must not be empty: it must contain at least 1 element");
    }

}
